package com.atguigu.day14.test03;

import java.util.Scanner;

/**
 * @author fenge
 */
public class Test03 {
    public static void main(String[] args) {
        System.out.println("请输入大字符串");//asdfghjkl
        Scanner s = new Scanner(System.in);

        String s1 = s.next();
//       s1="asdfghjklasdasddasfdsdfagasda";
        System.out.println("请输入小字符串");//fgh
        String s2 = s.next();
///        s2="asd";
        int count = 0;
        int i = 0;
//        while (s1.length()>s2.length()) {
//            if (s1.indexOf(s2) > 0) {
//                count++;
//                i = s1.indexOf(s2) + s2.length();
//                s1 = s1.substring(i);
//                i=0;
//            }
//        }
        System.out.println(s1.indexOf(s2));
        do {
            if (s1.indexOf(s2)>=0){
                count++;
                s1=s1.substring(s1.indexOf(s2)+s2.length());
            }
        }while (s1.length()>s2.length());
        System.out.println("出现了" +count+ "次");
    }
//    static String  findOut(int index,String strings){
//        String str = new String();
//        str = strings.substring(index);
//        return str;
//    }

}
